// custom-tab-bar/index.js
Component({
  data: {
    //选中的tab
    active:null,
    // 菜单列表
    list:[
      {
        pagePath: '/pages/index/index',
        text: '首页',
        name: 'index',
        flag:false,
        icon:'/static/tab_bar/homePage_normal.svg',
        selected_icon:'/static/tab_bar/homePage.svg'
      },
      {
        pagePath: '/pages/recording/recording',
        text: '记录',
        name: 'recording',
        flag:false,
        icon: '/static/tab_bar/Record_normal.svg',
        selected_icon:'/static/tab_bar/a.svg'
      },
      {
        pagePath: '/pages/mdcubs/mdcubs',
        name: 'mdcubs',
        flag:false,
        icon: '/static/tab_bar/ai.svg'
      },
      {
        pagePath: '/pages/encyclopedia/encyclopedia',
        text: '百科',
        name: 'encyclopedia',
        flag:false,
        icon: '/static/tab_bar/Encyclopedias_normal.svg',
        selected_icon:'/static/tab_bar/Encyclopedias.svg'
      },
      {
        pagePath: '/pages/personal/personal',
        text: '个人',
        name: 'index',
        flag:false,
        icon: '/static/tab_bar/Personal_normal.svg',
        selected_icon:'/static/tab_bar/Personal.svg'
      }
    ]
  },

  /**
   * 组件的方法列表
   */
  methods: {
    // 标签切换
    mdcubs(){
      console.log(this)
    },
    onChange:function(event){
      let get=event.currentTarget.dataset
      get.name != 'mdcubs' ? wx.switchTab({url:get.path}) : wx.navigateTo({url:get.path})
      
    },
  }
})
